package com.example.controller;

import com.example.dubbo.entity.User;
import com.example.dubbo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class controller {
    @Autowired(required = false) // 没有required = false会提示报错
    private UserService userService;

    @GetMapping("/api/getUserList.do")
    List<User> getUserList(){
        System.out.println("consumer ........");
        return userService.getUserList();
    }
}
